package com.link.base.base.reception.service;

import com.link.base.base.image.model.Image;
import com.link.base.base.image.service.AppImageService;
import com.link.base.base.reception.model.MeasureInfo;
import com.link.base.base.reception.mybatis.mapper.ReceptionMeasureInfoMapper;
import com.link.core.basic.dao.mapper.BasicMapper;
import com.link.core.basic.service.BasicServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 测量信息
 *
 * @author 黄正杨
 * @date 2019/04/17 14:41
 */
@Service
public class ReceptionMeasureInfoServiceImpl extends BasicServiceImpl<MeasureInfo> implements ReceptionMeasureInfoService {

    @Resource
    private ReceptionMeasureInfoMapper receptionMeasureInfoMapper;

    @Resource
    private AppImageService appImageService;

    @Override
    public BasicMapper<MeasureInfo> getBasicMapper() {
        return receptionMeasureInfoMapper;
    }


    @Override
    public List<MeasureInfo> queryByExamplePage(MeasureInfo entity) throws Exception {
        List<MeasureInfo> mList = super.queryByExamplePage(entity);
        for (MeasureInfo item : mList) {
            Image image = new Image();
            image.setModule("Measure");
            image.setParentid(item.getId());
            List<Image> list = appImageService.queryAll(image);
            item.setList(list);
        }
        return mList;
    }
}

